<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@include file="/commons/page/codegen.jsp" %>
		<script type="text/javascript" src="${ctx}/js/plugins/artTemplate/artTemplate.js"></script>
		<script type="text/javascript" src="${ctx}/js/gpoint/rdp/orders/orders.js"></script>
	</head>
	<body>
		<!-- 顶部按钮 -->
		<div class="wrapper wrapper-content  animated fadeInRight col-sm-12">
			<div class="panel-toolbar ">
				<div class="buttons">
					<a href="javascript:void(0);" class="btn btn-primary fa fa-save" ><span>保存</span></a>
					<a href="list.htm" class="btn btn-primary fa fa-back" ><span>返回</span></a>
				</div>
			</div>
			<div class="">
				<form  class="fr-form"  id="ordersForm" action="save.htm" >
					<input type="hidden" name="m:orders:orderNum"  value="${orders.orderNum}"/>

			 	<div class="fr_response_field col-sm-3" >
			 	<div class="fr-form-group"> 
				 	<label class="fr-control-label">ORDER_DATE</label>
				  	<div class="fr-form-block" data-type="fixed">
				<div class="input-icon" >
					<i class="fa fa-calendar"></i>
					<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="yyyy-MM-dd HH:mm:ss"   name="m:orders:orderDate"   value="<fmt:formatDate value="${orders.orderDate}"  pattern="yyyy-MM-dd HH:mm:ss"/>" validate="{required:false}"/>
				</div>
				  					
				 	</div>
			  	</div>
			</div>
			 	<div class="fr_response_field col-sm-6" >
			 	<div class="fr-form-group"> 
				 	<label class="fr-control-label">CUST_ID</label>
				  	<div class="fr-form-block" data-type="fixed">
				<input type="text" class="fr-form-control" name="m:orders:custId" value="${orders.custId}" validate="{required:false}"/>
				  					
				 	</div>
			  	</div>
			</div>
	  		<table name="s:" data-mode="inner" data-required="" class="table table-bordered table-hover table-condensed">
			<caption>
				<div class="fr-table-header-label">ORDERITEMS</div>
				<div class="fr-table-tools">
							<a class="btn btn-primary fa fa-add js-add-record"  data-type="add"  href="javascript:void(0);">添加</a>
							<a class="btn btn-danger fa fa-remove js-remove-record"  data-type="remove"  href="javascript:void(0);">删除</a>
				</div>
			</caption>
			<thead>
				<tr>
		     		 <th class="fr_table_col_checkbox" width="45px"><input role="checkbox" class="checkAll" name="s:" type="checkbox"></th>
	       			 <th>PROD_ID</th>
	       			 <th>QUANTITY</th>
	       			 <th>ITEM_PRICE</th>
		      	<th class="fr_table_col_remove" width="45px">管理</th>
		    </tr>
			</thead>
			<tbody>	
				<c:forEach varStatus="stat" var="order" items="${orders.orderItemsPoList}">	
					<tr>	
						<td><input role="checkbox" class="cbox " type="checkbox" name="s:" ></td>
				 		<td>
							
				<input type="text" class="fr-form-control" name="s::prodId:${stat.index+1}" value="${order.prodId}" validate="{required:false}"/>
												</td>	
				 		<td>
							
				<input type="text" class="fr-form-control" name="s::quantity:${stat.index+1}" value="${order.quantity}" validate="{required:false}"/>
												</td>	
				 		<td>
							
				<input type="text" class="fr-form-control" name="s::itemPrice:${stat.index+1}" value="${order.itemPrice}" validate="{required:false}"/>
												</td>	
						<td class="fr_table_col_remove" width="45px">
									
								<a title="删除" class="btn  btn-xs btn-outline btn-row js-remove-row" href="javascript:void(0);"><i class=" fa fa-times-circle-o  fa-lg fa-font-red"></i></a>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		
	<script type="text/html" id="s::TrTemplate">
	 
		<tr>
		  	<td><input role="checkbox" class="cbox " type="checkbox" name="s:" ></td>
	 	 	 		 	 	 	<td>
				<input type="text" class="fr-form-control" name="s::prodId:{{idx}}"  validate="{required:false}"/>
			</td>
<td>
				<input type="text" class="fr-form-control" name="s::quantity:{{idx}}"  validate="{required:false}"/>
			</td>
<td>
				<input type="text" class="fr-form-control" name="s::itemPrice:{{idx}}"  validate="{required:false}"/>
			</td>
		  	<td class="fr_table_col_remove" width="45px">
				<a title="删除" class="btn  btn-xs btn-outline btn-row js-remove-row" href="javascript:void(0);"><i class=" fa fa-times-circle-o  fa-lg fa-font-red"></i></a>
			</td>
		</tr>
	</script>
</form>

			</div>
		</div>
	</body>
</html>